package com.baoer.dao;

import com.baoer.entity.Shift;
import com.baoer.entity.Trip;
import com.baoer.entity.Triptype;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface TripDao {
    //旅行信息条数
    int countTrip(Map<String,Object> map);
    //查询旅行信息列表
    List<Trip> getTripList(Map<String,Object> map);
    //验重
    @Select("SELECT COUNT(*) FROM trip WHERE tripname = #{tripname}")
    boolean isTripNameExists(@Param("tripname") String tripname);
    //添加旅行信息
    int addtrip(Trip trip);
    int updatetrip(Trip trip);
    //删除旅行信息
    @Update("update trip set delflog = 1 where trip_id = #{tripId}")
    int deltrip(Integer tripId);
    //查看旅游信息详情
    Trip tripinfo(Integer tripId);

    List shiftlist(Integer tripId);

    int addshift(Shift shift);
    int tripday(Integer tripId);

    int countTriptype(Map<String,Object> map);

    List<Triptype> triptypelist(Map<String,Object> map);

    int addtriptype(Triptype triptype);

}
